fix the bug when switching floors