fixed bug when using multiple capture statements