finds file, but logic error