added (now broken again) promise version