removed unused code
fix for non-existing elements