switch to threadsafe long