Corrected while loop in exe_script