Added deprecation warning when a directory is detected