remove db_file in function argument.
chanage conn to global
add new function