Fixed selected error index issue.