fixed bug when serializing form data