fix check permissions