add orm writer function