made the check for categories dynamic

Signed-off-by: Floyd Pink <imbleedingme@googlemail.com>