scoped sessions preventing race condition