updated create db with error checks