added nancheck for velosity