add method to type and how to call method in type