Fix error that may create session multiple times