fix bug with public/index removal