fix overflow issues with more than 5 matches