fixing javascript to work on dev server