detect directories