fix some bugs when select files from clicking