fix uninitialized-pointer warning
fix unused variable warning