use Carp instead of die when attribute is required