ajax call termincating function updated