better exception handling for bad characters
catch socket timeeout error and better handle bad url characters