buffer now keeps the queue and added Promise.with