bug fixing, dealing with zero value for MaxTime