Use isdir() method