memory management issue fixed