This is not in the same while loop with encoder.