seperated server and cliet side code and removed autopublish