Making HTML output work with promises.