problem with cube domain smoke and shadow

I created a simulation of smoke and fire, but I have some objects in the scene in the background that I want to keep blurry (using the nodes).
I’m using an id mask_ indexOB .

when I render the scene I see the silhouette of the cube domain slightly overlapping the background!
the cube domain is not perfectly transparent.
I do not know if I’m wrong with the nodes or with the settings of the materials.

The only solution I found is to enable transparency in the shading panel and put the smoke with the cube on another render layer.
everything works but I wanted to keep everything on a level (render layers 1)