Improve onFailed() function :P