changed ajax code