Added check to prevent unnecesary updates.