fixed select rtrim statement to actually trim stuff
streamlining template for select() response