obvious bug in checking if the file existsw