update logic final