API has changed for jqueryui since the stackoverflor answer I copied was written