fixed xyz index bug