Fix set/getActivity creation function