Added inactive timeout handling and test case.