Added code to catch http errors when hitting stats page