fixed seg fault, now need to hunt down the return 1