adding onselect callback