make getOptions more robust