adding updating property optimize

optimizing code for updating and adding property;