check_symlink function added