fix bug where user chooses a non-existing file