Included stopServer variable into main instead of global variable