Added multi file support, added line exception hanlding