Fixed issue where capture loop task was not completing