change restype to type