invoke is not allowed from within a task block; refactor