improve detection of ajax request