validateArguments function

Validate arguments of a function