fix bug of calculating time of link