fixed segfault on no file
fixed segfault on missing pdf