fix error handling for status code