fix to get the final match