Fix missing end statement