Update the keys in an object array dynamically