Forgot to call freeMemory() function