fix script
remove null values
support more kinds of dates, better logging, etc.