removed some apparently unnecessary code and fixed a threading issue