#84 Fixed concurrency issue with state references being passed between threads