fix stack overflow when moving files between filesystems