bug fix when speed is 0