use foreach for history entry iteration