some bugfixes so that form submits properly