Could you explain your use case a bit more and post a code snippet so that we can have a look, please?
PS: you can post code snippets by wrapping them into three backticks ```, which makes debugging easier.