re-designed the procedure of server register,
to avoid duplicated registration.