Adds missing end statement