add support for showing a max number of results