added pdf read exception handling