searching the entrance to come out