fixed multiple matches bug