Prevent CM from going beyond the screen on the right side