refactor getselections into a reactive function and remove need for global selectedFields variable.