Made compatible to new permissions