working on update logic