Fixed undefeined variable warning