fix duplicate rules bug