Fix deleting bug