updated date function