fix the door sense, clarify the code