fix callbacks on error