diff --git a/progit/templates/pull_request.html b/progit/templates/pull_request.html
index 417edfb..2fec5e8 100644
--- a/progit/templates/pull_request.html
+++ b/progit/templates/pull_request.html
@@ -134,7 +134,8 @@
'pull_request_add_comment', username=username, repo=repo.name,
requestid=requestid, commit='', row='') }}".slice(0, -1);
url = url + commit + '/' + row;
- var table = $( this ).parent().parent();
+ var current_row = $( this ).parent();
+ var table = current_row.parent();
var next_row = table.find('#' + (+row + 1)).parent().parent();
if (current_row.next().find('.pr_comment_form').length == 0){
$.get( url , function( data ) {