Use .then() instead of deprecated .pipe()

Change the use of .pipe() for .then().
.pipe() is deprecated since jQuery v1.8 (http://api.jquery.com/deferred.pipe/)