fixing uninitialized variable bug.