Using deferred object replace the ajax callback mechanism.