bugfix: nBands was removed before being used in the select clause