Fixed bug that made the form stay open after submission