add global.r
modified server and ui