added handler on croak