Okay I have fixed this, I had tried this method before but it does not appear to add the new hash to the base hash.
I am mystified as to what is going on in my code, or rather why the counter field is always displayed as 0, and only the 'new instance' debug message is ever given even though Year, Month, Referer and Hour are identical on subsequential calls.