Add config file for db configuration and fix insert bug