fixed the selection code in gs