Added check to ensure model file is only opened if it exists. Also removed unused view file