fix i undefined