fix code to make call to server