added check of function type in arguments