tidied up permissions related stuff