Changed check for ajax request