fixed potential NPEs in DBHelper