fixed callback check on error