rework global ajax callbacks and attach a Flash check to ajaxComplete