fixed python server function