Fixed small bug in on_failure, old parameters were used.