Added a boundary check to the forceOut function