Fix file_exists method when using different storage classes