fix a bug in the velocity gradient