   cite_collection_editor_config = $.extend({}, default_cite_collection_editor_config, window.cite_collection_editor_config)
   google_oauth_parameters_for_fusion_tables['client_id'] = cite_collection_editor_config['google_client_id']
   
-  if location.hash.substring(1).length
+  if location.hash.substring(1).length && !(parse_query_string()['state'])
      console.log "Setting OAuth URL parameter state: #{location.hash.substring(1)}"
      google_oauth_parameters_for_fusion_tables['state'] = location.hash.substring(1)
   

  else
    window.location.href + new_hash
  history.pushState(null,$(selected).text(),new_url)

build_collection_editor_from_capabilities = (capabilities_url) ->
  $.ajax capabilities_url,

  properties = $(collection).find('citeProperty')
  add_property_to_form(property,form) for property in properties

  submit_button = $('<input>').attr('type','button').attr('value','Submit').attr('class','btn btn-primary').attr('id','submit_button')
  submit_button.bind 'click', (event) =>
    submit_collection_form()
  save_button = $('<input>').attr('type','button').attr('value','Save').attr('class','btn')
