fixed writing to db