shared the door() function