Can you please give us the problemetric code snippet and point out where you think the culprit can be?
Your desciptions are generic and from it we can not make out anything.

||| Dharma |||.