update setupmoh function to access db