fixed a bug on datepicker