fixed kernel loop error