bug fix for valide date