Check if handler is a function