return result from promise once it is resolved.