Added type check to method