new way writting buffer