fix missing end statement