made it write to database