Exception handling

Implemented Error Dialog Box when the input file is useless, and exit cleanly when cancelling loading file.