use File.directory? instead of FileTest.directory?