removed some fs sync calls