database functions for creating IOU