Added check for correct file before setting it as a selected file. Need
to test it.