See this discussion
If that doesn’t help you might need to provide some more code snippets for others to help out.