I think it might be better to just declare `$div`, `text` and `$textarea` here, then put the assignment and other stuff in this block in