fixes form so there is not a loop in a loop