fixed seg fault on exit