Fix database issue

issue #12