nasty query to only show categories that have books