       $('#collection_select').chosen()
       $('#collection_select').bind 'change', (event) =>
         $('#collection_form').remove()
+        $('#collection_access_error').remove()
         selected = $('#collection_select option:selected')[0]
         selected_collection = $(data).find("citeCollection[class=#{$(selected).attr('value')}]")[0]
         build_collection_form selected_collection

        access_token_cookie += "path=#{window.location.pathname.substring(0,window.location.pathname.lastIndexOf('/')+1)}"
        console.log 'Wrote access token cookie: ' + access_token_cookie
        document.cookie = access_token_cookie

$(document).ready ->
  set_access_token_cookie parse_query_string(location.hash.substring(1))

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

  # test table access
  if get_cookie 'access_token'
    $.ajax "https://www.googleapis.com/fusiontables/v1/tables/#{$(collection).attr('class')}?access_token=#{get_cookie 'access_token'}",
