Fix Uncaught TypeError: Cannot call method 'contains' of undefined caused by Fix in 119f1f6

...and fixed the resulting error Uncaught TypeError: Cannot call method 'contains' of undefined