added guards to prevent breaking on file completion with paths starting with a -