updated response_code to handle multiple erros