Fix empty session bug