binding function when selected file