Fixed null session bug