added storing function for selected categories into app preferences