added error handling, attempting pdf conversion