Fixed issue with non-existing elements