fix infinite loop enumerating formats