Resolve a promise