fix buggy path autocomplete behaviour