replaced another foreach