Hi @blah
I’m not sure that I follow the code you posted. If you post a complete minimal example – one that I can copy & paste and run to see the error – I think I might be able to help.
You can also see this post which adds a dbc component in a function: