fix bug with fetching the wrong match group