fix error if no cat was defined and use list comprehension to also strip whitespace