database checking & creation