Added a bit more error handling when attempting to connect with EC2 box