check if index is None (as it will be for local directories and maybe devices)