Fixed nullpointerexception on disconnection