add edit and save function.