fixed ajax handling