Fix return of ajax function object