added init functions of database and table