fixed some regression issues with earlier permission fix