fixed debug build segment fault