Use sync/atomic for incrementing id