这个英语句子错在哪?

问题描述:

这个英语句子错在哪?
If we are sincere in speech and behavior,we would be able to resist temptations while gain good relationships.

while后边的gain应该是gaining
介词后跟动名词形式