fixed the bug about the usage of uninitialized variable