fixed concurrency problem, removed unused code