fix memory issue with block