fix bugs in for_dateset.py