Fixing sge recover function