added catogeries handling