fix potential bugs (Uninitialized scalar field, uninitialized pointer field)