fix to previous commit and fix for location policy if location is not set but function is set case