fixed bug when pending cube
simplify add a reference in a cache