listFiles method now fails cleanly if no directory exists