added log to checkCategory for debugging