bug fix for max velocity