[fixes #50975415] Fix ajax function.