console app was fixed to correctly work in multiple threads