fixed bug when calling logmsg