fixed update & delete bugs