Added a little bit more logic to the activity refresh.