adding ajax event capture and alert box