error management if file not properly opened