Fixed session race condition