before Write func add