remove the unused avatarIndex variable