fix server session loop