Fixed null pointer exception in FileManager