use -1 for no limit