typo in the script example
fixed loging and bug on empty categories
logging fixed