Fix leave bug