Sixth-grader confesses to writing bomb threat