Added thread save implementation to concurrent operations
Fixed memory bug