fix missing condition in file wrapper