fixed memory issues detected by ASAN
corrected location and use 2.0.1