fixed bug with local storage and 'use strict'

'use strict' was complaining about selectedIds being undefined, which
prevented saving to localStorage. added 'var' before variable to fix.