Added extra check on dom