Fixed a bug in enableNonPublicAccess = true