duplicate query fix