Using a pointer var to solve a Segfault on MacOSX