Reformatted Code, connectionexception handling refreshed