add type check for methods