datestamp logic added.