Fixed minor bug where session would hang