try to handle http errors