confused by inconsistent behavior of matrix Here's my code block:

{% extends "_layout" %}

{% block content %}
    &lt;article&gt;
        &lt;h1&gt;{{ entry.title }}&lt;/h1&gt;
        &lt;p&gt;TEST EDIT 8&lt;/p&gt;
        {% for block in entry.blogPost %}
            &lt;p&gt;heading - {{ block.heading }}&lt;/p&gt;
            &lt;p&gt;sub heading - {{ block.subHeading }}&lt;/p&gt;
            &lt;p&gt;accolade- {{ block.accolade }}&lt;/p&gt;
        {% endfor %}

        &lt;p&gt;Posted on {{ entry.postDate.format('F d, Y') }}&lt;/p&gt;
        {{ entry.body }}
    &lt;/article&gt;
{% endblock %}




And here's the error message I am getting on an inconsistent basis:


  Craft\MatrixBlockModel and its behaviors do not have a method or closure named "heading"


I've tried to remove the other Matrix fields from the template, and just isolate on the 'block.heading' field, and I get really strange behaviors. Sometimes the template renders fine, and the dynamic value gets rendered by the page. Sometimes, with a different content entry, the same template gives the above error message.

I'm brand new to CraftCMS. Is there an obvious syntax mistake I'm making?
Since you have 3 block types in your Matrix, you need to check for the block type before trying to call an inner field. 

{% block content %}
    &lt;article&gt;
        &lt;h1&gt;{{ entry.title }}&lt;/h1&gt;
        &lt;p&gt;TEST EDIT 8&lt;/p&gt;
        {% for block in entry.blogPost %}
            {% if block.type == 'imageCaption' %}
                &lt;p&gt;heading - {{ block.heading }}&lt;/p&gt;
                &lt;p&gt;sub heading - {{ block.subHeading }}&lt;/p&gt;
            {% elseif block.type == 'WhateverTypeAccoladeIsIn' %}
                &lt;p&gt;accolade- {{ block.accolade }}&lt;/p&gt;
            {% endif %}
        {% endfor %}

        &lt;p&gt;Posted on {{ entry.postDate.format('F d, Y') }}&lt;/p&gt;
        {{ entry.body }}
    &lt;/article&gt;
{% endblock %}


You should add that check before block.accolade as well for whichever block type accolade is in.