Fixed another bug that may cause session handler to return NoneType