Fixed button: now stops when out of bound.