added internal elements checking