more general solution of the gripper position hack