Made selection work in graph