adding onErrorSendBadRequest