Close connection when form is submitted or reset

Closes #27 until we find a new website that uses a different method