Fixed error in retrieving selected profile's activity

Fixed error in retrieving selected profile's activity, now using a nicer
solution.