fixing constant buffer premature destruction