Some changes in ajax function and update page functional