Fixed: server crashed if res was not set