fixed a memory issue