Fixed crash on disconnection