with folding mode added