fixed fs global leak issue and test failure