Fix a bug of capture template