Fix script not waiting for user input to continue