fix duplicate categories bug