fixed bugs and add test
test fs