Fix bug in add categories