updates to database functions for iterms