added missing logic for two schemes