add server save logic