fix the defect from last improve and fix the dangling symlink problem