check if a directory exists