correcting non terminated statements