fixed update and deletion handling