fix a bug introduced in commit: cf941c2bb93104682de639d93a7abbcc8d640977
and update the database file with structural changes