added categories checking