fixed bugs in FileManager