Potential memory issue fixed