edit function in each mode