Fixed http Client error handling