Added event handlers for item selection