modified the code to eliminate one more foundation API call when foundation API calls are disabled