A fix to the segfault because I need to pass the object I created outside of function scope assigned to memory that 'persists' in some way.