Added correct error checking to the refresh method so it won't segfault when the url is empty.