fix test_db entry in build blocks
improve build blocks
 add db login manager