Fixed bug with handling regex mismatch