bug fixing regarding the base code of db connect