fixed bug in editing categories;