modify ending statement