clear invalid codes