fix select with multiple attribute, now returns array

Currently, select only shows the first selected element if the multiple attribute is used.
Added code to detect a multi select and return array if need be.