fix for export permits query - use the view