Fixed any possibility of a memory leak