added if/else loop in new_or_edit, added categories path