fixed logging
fixed error with time = 0