optimize error handling for group capture & find a bug,to be fix