Fixed bug in time update