Add input file format checking at controller.cc