Updating logic behind checking for files, folders and symlinks