added file print on error