Move metadata.select calls outside of loop that sets checkboxes

removes storm of unnecessary metadata.select server calls