added logic for summary switching based on available attributes