Afraid not, but I now see the reason of the problem.

Inside a tick or tock function, month(0) is the current time. month(1) is the end of the previous bar. Depending on when the function runs, both can be identical. So your comparison is not good, even if it may have worked sometimes. For correctly finding a month change, either compare month(0) != month(1) in the run function, or compare month(0) in the tock function with month(0) of the previous tock.