add key value protection on pick_sample