added ability for selectedoption to be dynamic