form loop fix