only error handling for loop missing