remove invalid patches