fixed write fh management bug.