memory leak in server loop