milestone S9
inserting an if statement to check if there was an error connecting to the connection errors