fix bug with Promise.done()