Detect category duplication.
Fixed save setting event range.
Reset_category function removed previous. So remove the code remained.