add limit option, and fix bugs with domain, and sort order