fixing form data function