renamed message class to msg to avoid name clashes