fix a bug in doKinematics