add BeforeAjax callback