Added more session handeling