Fixed segfault
Attempting fix