fix ajax status code error handling