The funny thing about English is that you have to speak and hear it to write it. English is not a phonetic language like Ukrainian whose words are all written how they sound, but a and an are entirely based on how the proceeding word sounds. Of course it is possible to think whether or not the proceeding word starts with a vowel, however that takes up too much time. It is likely that people who learned to write English instead of speak it make the mistake of, for example, an pizza, or a igloo.