fix deleting bug