memory issue partial fix