fixed ajax code

still need to get rid of superfluous pre