db connection function changed