made pagination optional