Updataed to fix non array selects