fix unused vars + resources permissions