foreach works