change all instances of loc to key