Fix bug of uninitalizing variable