added ignore hidden, implementation of path loop detection