Server While -> Do

Changed the while loop for the server response.