fixes #36
fixes #48
more help
#44 - trying to fix issue. moved condition before append of lines because after append its difficult to be at the end

this if might caused the issue:
if ($(window).scrollTop() == $(document).height()-$(window).height()){
$(document).scrollTop($(document).height());
}