bug fix & security improve

bug fix when rename folder but not rename sub folders in db.
add security improve when rename folder, create folder