fixed write result