move path if loop inside form submit