i dont see anything wrong in the code.
it is extremely difficult (read impossible) to fix a problem that you cannot reproduce.
without being able to reproduce the problem, there is no evident troubleshooting path for us to take to find the cause of the problem.
If you can reproduce the problem, we can troubleshoot it to find the cause.
Just like bringing your car to the mechanic, if he cant hear the strange noise that prompted you to bring it in, he wont be able to find or fix the problem.