fixed crash if incorrect date was selected