refactored response error