use croak instead of Carp::longmess to avoid 'Deep recursion' issue