Add missing end statement