Added auto discovery of min and maxi id if start_id aand/or stop_id are not specified