created if statement to reset session counter