fix with empty elements lists or null