actually make a db connection, and eliminate unneeded update duplicate function