fixing conditional single letter flag logic