Fix bug with check privileges