add datepicker and fix some bugs