update time the right way