fix auto delete logic
fix auto delete logic