added selection event handler, have to think about how to handle delete and updates