I cant really speak to why it was working before, then stopped. All I can really do is look at the code you posted and try to spot what is wrong based on the description you provide.
If there was no code change at all, then it should not have been working before.
Does the code change I suggested fix the issue?