Added req param to onFail