move ajaxFree to beginning of success callback