change $.defer to $. Deferred to match jQuery's API