core: fixed bug introduced when changing fold