finish message class with a loop