I only added this because It doesn't work with mock-serial without this check.