Added check that file is selected