When asking a question about a problem caused by your code, you will get much better answers if you provide code people can use to reproduce the problem. That code should be…
- …Minimal – Use as little code as possible that still produces the same problem
- …Complete – Provide all parts needed to reproduce the problem
- …Verifiable – Test the code you’re about to provide to make sure it reproduces the problem
This article from StackOverflow give hints on how to make a good MVCE: