Fix uninitialized var bug