catch error on reading file