add a field to database

fix some small design issues