use croak rather than die