added os.mkdir to ensure files dir is created.