CHG: Changed the way the time of last connection is calculated