Change the signature of the close method. Now it returns a promise.