Fixed GUI freeze issue on threading.