change css style and add undo function after search