updating Error for permissions and only calling Stat once