creates db instance