     )
 # discussions
 
-getNextURL = (button_url) -> 
-  console.log("0" + button_url)
+getNextURL = (button_url) ->
   current = document.URL
+  newURL = current
   lastBackslash = current.lastIndexOf("/")
-  
   #checks if main url has backslash in the way
   if lastBackslash == current.length-1
     current = current.substr(0, lastBackslash)
-    
   #if current is already on a page number remove current page number
   if current.lastIndexOf("?") > -1
     newURL = current.split("?")[0]
-    console.log("1" + newURL)
-
   if button_url.lastIndexOf("?") > -1
-  	console.log("2" + button_url)
   	page_number = button_url.split("?")
-  	newURL = current + "?" + page_number[1]
-    
-  console.log("3 changing:" + button_url + " to:" + newURL)
+  	newURL = newURL + "?" + page_number[1]
   newURL
   
 getPageParam = () ->

      $("#group-discussions").removeClass('hidden')
      $("#discussions-loading").hide()
    )
$ ->
  if $("body.groups.show").length > 0
    $(document).on('click', '#group-discussions .pagination a', (e)->
      unless $(this).parent().hasClass("gap")
        if html5.supported
          window.history.pushState("stateObj", "title_ignored", getNextURL($(this).attr("href")))
          console.log("html5 supported")
        $("#discussion-list").hide()
        $("#discussions-loading").show()
        $('#group-discussions').load($(this).attr('href'), ->

#*** HTML5 SUPPORT ***
canvasSupported = !!window.HTMLCanvasElement
html5 = exports ? this
html5.supported = true if canvasSupported
