modify pick function