fixed dealing with -xi