Fix not calling callback when error