selectData function now option to clear returnVal before modfying or not