added a while loop to keep the connection alive until the quit command is sent