fixing check permissions