Add before, after and invoke_task