First half of sampling fix