use writebacth to do atomic write