updated js error to include duplicates