made the code more stable
moved the instancing of object to another place that it is in the same thread
made it still more stable