fixing object leak in transparency code