Error response

Added error response function.