detect file presence correctly