fixed a bug in isUnitVector