Add timeouts and fix Regex bug