fix missing 'end'