Ensuring that the function argument is actually a function