check if type is a function