changes before ajax logic