foreach replace atom to upper list