added update logic