fix callback on error