Avoid "Cannot read property 'getAttribute' of undefined" errors 

Avoid "Cannot read property 'getAttribute' of undefined" errors  when target element doesn't exist anymore.