fix race condition on Open Terminal