Fixes a performance issue with activity records