Fixed memory crashing issue (hopefully)