bugfix: fix a bug that has no permission writing file to system directory