add wait_timeout altering to allow script to finish properly