Only do it if its a directory.
Better debugging.