add missing "end" and split line