fix write file bug defaust dir change to user.home