use atomic to read/write value of Entity to avoid concurrency issue