Tried to fix braking bug; not sure wheter it works