main from server