Added some control flow to geofencing.