fix bug in getAllContent javascript function