fix for memory release