fixed undefined variable and extended yes regex