This tends to happen if the butter you're using has softened too much before adding it to your dry ingredients. When the butter being added is too soft, it will melt faster in the oven and this can lead to the cookies going flat before they've had the right amount of time to set.