Fixing a bug with onlyOptionSelected null pointer exception