fix select collection and add two functions