tweak the server side code to accommodate client side