fix folder selection; fix StackOverflowError