removed concurrency and fixed scoping bug