update onFailure method