added some http error handling, and loggin back in again