exiting when invalid value is passed in as a date

@triblondon @AlbertoElias