refactor: check addTaskFunction() arguments