Make thread safe, don't use long