use stdexcept for invalid_argument