Changed promise to defer