TypeError: Cannot call method 'match' of undefined. fixed.