Modified map ,, to different action according to file type