nwillems: call the callback with an error or with the new key when it is successful