check permission bits properly