Added validation of input in scan_dates