Another way of handling url errors