Checks if directories exist