fix Select function to actually receive data