get_last_activities function added.