added selection functionality