Added Try function

Checks if files are correct. Otherwise throws exception