Fixed little bug in leave event