try to use formdir but it runs the same part three times and I don't understand why