corrected creating th elements