works locally and on server