Fix bug where decode is selected before file open

Check file exists before using it