change foldnestmax to 2