function overload and type check