thread safe Next logic