fixing renderer, fixed segfault when exiting