How can I keep the form functioning correctly?