implement limit when querying topics