change code to work on server