Added MessageQueue + cleaned up disconnection process and thread termination