made speed 0 if nan