Added event to handle disconnecting