foreach changed to good practices mode