Issue 36 database fix

close #36