jQuery Deferred Helper Function