adding croak for exit