modify try except
added the date calculate
modify the try except