Fixing a runtime error. TODO: I have to fix the stop_server method.