Fix run_server function