writing on db works