Fixed backwards logic in eventInComCat function