added debug message class, improved thread starts