Fixed client not closing when connected to server