First off - welcome to the forum!
When you open and close the top, you need to hold the switch down until the light shuts off - not just to the point where you think it's opened/closed. Are you doing that? If not, cycle it thru until the light shuts of and all will be good again!