Fixed missing error handling block