Added AJAX for modal switching on recording stop