added msg procedure