added error handling for incorrect url