changed InvalidArgument to ArgumentError