fix write path