fixed ajax to make tests pass