replace main with server