save db connection in each template