add safe_symlink to catch existing file and broken link case