replaced task run wrapper by a hook which is more transparent and less intrusive