fixed file autocomplete to work properly with directories