add global.R, update server and ui