fix max match issue