update edit files logic