Promise to set a variable otherwise return