Kinda fixing memory problems