Added missing permission check