fixed write issue