modified the new function to about ajax