Fixing javascript to mock out workflow