fixed a bug with subsequent matches retaining captures of previous ones