fix loop through multiple tasks