need further fix about just writing means into db