fixed some additional troubles but still having memory issues