fixing bug on renaming folder (issue #259)