Fixed bug when editing an existing category