Fix an error in querying recent activities