allow a function to be passed as a task