fixed error with time = 0