Adding foreach loop with keys