restored 'write_to_cert' method after merge conflict