memory free fix