Added check before loading session