Init function for connecting to the db