fixed some bugs in init_smsg