update timestamp logic