create db and bugfixes