cleanup client disconnects, and application closes