Change method of detecting ajax request