add function for select