hacky fix to ensure that motors stop at the end