resolved segfault issue in driver.c