Added another console log. Something is obviously wrong with the doucment length value