changed delMsg function