Adding function on the treeview