remove log, add defer