try to write to db