Database creation and checking added