made improvements in the connection and error handling there is still
some issue with connection and testing the connection and reestablishing