resolve conflict of for and finally