fix bug where msg variables were not initialized properly