fix rotateAxis function