fixed bugs on AFS reading