Fixed out of index error when content is empty