Replaced peg[id] with peg[[id]]