fixed a null-session bug for refresh.