fixed bug: duplicate variables in select