support user defined class in function parameter