fixed the permission checks