Fixing condition to check for id existence

Not sure if 'e.getAttribute("id") != null' is needed.