Fixed bug: fields were wiped before data was extracted on submit