self delete logic added