throw exception when last statement is incomplete