change dispatch() to return promise
pub