wire up promise correctly