modify select function