Added code for getting the lastscan datetime.