Added checks for a bad input URL