added logic to remove session in case interrupted connection