added dir scanning and path setting