added check for duplicate category name and made slug unique