adjusted client side code to be able to run stata script