fixed foreach all done order before work call