add validation function for category edit page