Fix for memory issues crashing (hopefully)