multi threaded synchronization added.