delete unnecessary messages