Updated to reflect changes to correctly use activity object