updates to the SQL for IOModel