Fix permission error on sync