Added code to handle case when folder is selected in file browser