added promise.js to eliminate the dependence on jquery deferred